<?php
use yii\bootstrap\ActiveForm;

?>
<style>
	.payBody {padding:0 95px;margin-top: 30px;text-align: center}
	.payBody .list{margin-bottom: 20px;}
	.payBody .name{margin-right: 20px;}
	.payBody input[type="text"]{width: 256px;height: 34px;}
	.payBody .btns{padding: 3px 30px;background-color: #fe7b9d;color: #fff;border-radius: 5px;}
	.payBody .btns.rest {background-color: #a4a9ad;}

	.myclass .n-icon{
		display: none !important;
	}
	.form_position{
		position: relative;
		top:40px;
		margin: 0 80px;
	}
	.form-group{
		padding-bottom:20px;
		margin-bottom: 5px !important;
	}
	.tab_position{
		left: 65px;
	}
</style>
<div class="main">
        <div class="hide"><iframe name='send_post' id='send_post'></iframe></div>

			<div class="payBody">
				<?php ActiveForm::begin(['id' =>'payForm','options'=>['target'=>'send_post','name'=>'register']]);?>
				    <div class="list form-group">
				        <span class="name">货款</span>
				        <input type="text" name="finance_money" id="finance_money"/>
				    </div>
				    <div class="list form-group">
				        <span class="name">赠送</span>
				        <input type="text" name="finance_give_money"/>
				    </div>
				    <div class="list form-group">
				        <span class="name">记录</span>
				        <input type="text" name="finance_remark"/>
				    </div>
				<div class="text-center  tab_position">
					<span class="btnMd mr20">
						<input type="submit" value="确定" style="display: inline-block; width: 100%; background: 0;line-height: 25px; border: 0"  />
					</span>
					<span class="btnMd bg_rest ">
						<input type="reset"  class="rest" value="取消" style="display: inline-block; width: 100%; background: 0;line-height: 25px; border: 0"  />
					</span>
				</div>


				<?php ActiveForm::end();?>
			</div>


	</div>
<?php $this->beginBlock('js_index') ?>

	$('form[name="register"]').validator({
	focusCleanup: true,
	stopOnError:false,
	//debug: true,
	timely: 2,
	//自定义规则（PS：建议尽量在全局配置中定义规则，统一管理）
	rules: {
	length:[/^\S{0,20}$/, '请输入内容,最长20位字符'],
	decimal: function (element, params) {
		return /^[0-9][0-9]{0,5}\.[0-9]{0,2}$/.test(element.value) || /^[0-9][0-9]{0,5}$/.test(element.value) || '请输入数字类型,最长6位数字';
	}
	},
	msgClass: "n-bottom myclass",
	fields: {
		'finance_money':{
			rule:"decimal",
			tip:'请填写金额',
		},
		'finance_give_money':{
			rule:"decimal;",
			tip:'请填写金额',

		},
		'finance_remark':{
			rule:"length",
			tip:'请填写记录',
		},
	},


	});
<?php $this->endBlock() ?>
<?php $this->registerJs($this->blocks['js_index'], $this::POS_END); ?>
<?php $this->registerJsFile("@web/system/suppliefinance/payment.js",['position'=>$this::POS_END]);?>